using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Colman.Rpg.Messaging
{
    /// <summary>
    /// Represents a chat message sent from the player to the server for distribution.
    /// </summary>
    [Serializable]
    public class ChatMessageRequest : RequestMessage
    {
        /// <summary>
        /// Creates a new instance of <see cref="ChatMessageRequest" />.
        /// </summary>
        /// <param name="messageBody">Represents the body text of the message.</param>
        /// <param name="messageColor">Represents the color of the message.</param>
        /// <param name="destinationType">Represnts the type of destination for the message (private/public).</param>
        private ChatMessageRequest(string messageBody, Color messageColor, ResponseDestination destinationType) 
        {
            this.messageColor = messageColor;
            this.messageBody = messageBody;
            this.destinationType = destinationType;
        }

        /// <summary>
        /// Creates a new instance of <see cref="ChatMessageRequest" />.
        /// </summary>
        /// <param name="messageBody">Represents the body text of the message.</param>
        /// <param name="destinationUser">Represents the user the message is destined for, if <see cref="DestinationType"/> is set to <see cref="ResponseDestination.Manual"/>.</param>
        /// <param name="messageColor">Represents the color of the message.</param>
        public ChatMessageRequest(string messageBody, string destinationUser, Color messageColor)
            : this(messageBody, messageColor, ResponseDestination.Manual)
        {
            this.destinationUser = destinationUser;
        }

        /// <summary>
        /// Creates a new instance of <see cref="ChatMessageRequest" />.
        /// </summary>
        /// <param name="messageBody">Represents the body text of the message.</param>
        /// <param name="messageColor">Represents the color of the message.</param>
        public ChatMessageRequest(string messageBody, Color messageColor)
            : this(messageBody, messageColor, ResponseDestination.Everyone)
        {
        }

        #region Color MessageColor { get; } (messageColor)
        private Color messageColor;

        /// <summary>
        /// Gets the color of the message.
        /// </summary>
        public Color MessageColor
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.messageColor;
            }
        }
        #endregion

        #region string MessageBody { get; } (messageBody)
        private string messageBody;

        /// <summary>
        /// Gets the body text of the message.
        /// </summary>
        public string MessageBody
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.messageBody;
            }
        }
        #endregion

        #region string DestinationUser { get; } (destinationUser)
        private string destinationUser;

        /// <summary>
        /// Gets the user the message is destined for, if <see cref="DestinationType"/> is set to <see cref="ResponseDestination.Manual"/>.
        /// </summary>
        public string DestinationUser
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.destinationUser;
            }
        }
        #endregion

        #region Destination DestinationType { get; } (destinationType)
        private ResponseDestination destinationType;

        /// <summary>
        /// Gets the type of destination for the message (private/public).
        /// </summary>
        public ResponseDestination DestinationType
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.destinationType;
            }
        }
        #endregion
    }
}
